from django.db import models
from utils.basemodel import BaseModel

# Create your models here.
class Nav(BaseModel):
    name=models.CharField(max_length=30,verbose_name="导航名称")
    url=models.CharField(max_length=200,verbose_name="导航链接")
    ishttp=models.BooleanField(default=False,verbose_name="是否是http链接")
    position=models.IntegerField(default=1,verbose_name="导航位置")
    class Meta:
        db_table="fgnav"
    def __str__(self):
        return self.name


class Banner(BaseModel):
    title=models.CharField(max_length=30,verbose_name="图片名称")
    ishttp=models.BooleanField(default=False,verbose_name="是否为连接")
    imgurl=models.CharField(max_length=200,verbose_name="图片的路径")
    url=models.CharField(max_length=200,verbose_name="跳转的路径")
    class Meta:
        db_table="fgbanner"
    def __str__(self):
        return self.title